

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>Prometheus 模块 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="Influx 模块" href="../influx/" />
    <link rel="prev" title="本地存储池模块" href="../localpool/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../">Ceph 管理器守护进程</a></li>
      <li class="breadcrumb-item active">Prometheus 模块</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../_sources/mgr/prometheus.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">Ceph 管理器守护进程</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../administrator/">安装和配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../modules/">模块编程</a></li>
<li class="toctree-l2"><a class="reference internal" href="../orchestrator_modules/">编写 orchestrator 插件</a></li>
<li class="toctree-l2"><a class="reference internal" href="../dashboard/">仪表盘模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../ceph_api/">Ceph RESTful API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../alerts/">Alerts 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../diskprediction/">DiskPrediction 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../localpool/">localpool 模块</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Prometheus 模块</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id1">启用 prometheus 输出</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id2">配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="#ceph">Ceph 健康检查</a></li>
<li class="toctree-l4"><a class="reference internal" href="#rbd-io">RBD IO 统计</a></li>
<li class="toctree-l4"><a class="reference internal" href="#ceph-daemon-performance-counters-metrics">Ceph daemon performance counters metrics</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id3">统计的名字和标签</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#osd">存储池和 OSD 元数据系列</a></li>
<li class="toctree-l4"><a class="reference internal" href="#node-exporter">关联驱动器统计信息与 node_exporter</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#label-replace">使用 label_replace</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id6">Prometheus 服务器的配置</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#honor-labels">honor_labels</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id7">node_exporter 主机名标签</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id8">配置实例</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#id9">注意事项</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../influx/">Influx 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../hello/">Hello 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../telegraf/">Telegraf 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../telemetry/">Telemetry 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../iostat/">Iostat 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../crash/">Crash 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../insights/">Insights 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../orchestrator/">Orchestrator 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rook/">Rook 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rgw/">RGW 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mds_autoscaler/">MDS Autoscaler 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nfs/">NFS 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../smb/">SMB module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../progress/">Progress 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cli_api/">CLI API 命令模块</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="prometheus">
<span id="mgr-prometheus"></span><h1>Prometheus 模块<a class="headerlink" href="#prometheus" title="Permalink to this heading"></a></h1>
<p>Provides a Prometheus exporter to pass on Ceph performance counters
from the collection point in ceph-mgr.  Ceph-mgr receives MMgrReport
messages from all MgrClient processes (mons and OSDs, for instance)
with performance counter schema data and actual counter data, and keeps
a circular buffer of the last N samples.  This module creates an HTTP
endpoint (like all Prometheus exporters) and retrieves the latest sample
of every counter when polled (or “scraped” in Prometheus terminology).
The HTTP path and query parameters are ignored; all extant counters
for all reporting entities are returned in text exposition format.
(See the Prometheus <a class="reference external" href="https://prometheus.io/docs/instrumenting/exposition_formats/#text-format-details">documentation</a>.)</p>
<section id="id1">
<h2>启用 prometheus 输出<a class="headerlink" href="#id1" title="Permalink to this heading"></a></h2>
<p><em>prometheus</em> 模块可这样启用：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><style type="text/css">
span.prompt1:before {
  content: "$ ";
}
</style><span class="prompt1">ceph<span class="w"> </span>mgr<span class="w"> </span>module<span class="w"> </span><span class="nb">enable</span><span class="w"> </span>prometheus</span>
</pre></div></div><section id="id2">
<h3>配置<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h3>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The Prometheus manager module needs to be restarted for configuration changes to be applied.</p>
</div>
<dl class="std confval">
<dt class="sig sig-object std" id="confval-mgr-prometheus-server_addr">
<span class="sig-name descname"><span class="pre">server_addr</span></span><a class="headerlink" href="#confval-mgr-prometheus-server_addr" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>the IPv4 or IPv6 address on which the module listens for HTTP requests</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">::</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mgr-prometheus-server_port">
<span class="sig-name descname"><span class="pre">server_port</span></span><a class="headerlink" href="#confval-mgr-prometheus-server_port" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>the port on which the module listens for HTTP requests</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">9283</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mgr-prometheus-scrape_interval">
<span class="sig-name descname"><span class="pre">scrape_interval</span></span><a class="headerlink" href="#confval-mgr-prometheus-scrape_interval" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">15.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mgr-prometheus-cache">
<span class="sig-name descname"><span class="pre">cache</span></span><a class="headerlink" href="#confval-mgr-prometheus-cache" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mgr-prometheus-stale_cache_strategy">
<span class="sig-name descname"><span class="pre">stale_cache_strategy</span></span><a class="headerlink" href="#confval-mgr-prometheus-stale_cache_strategy" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">log</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mgr-prometheus-rbd_stats_pools">
<span class="sig-name descname"><span class="pre">rbd_stats_pools</span></span><a class="headerlink" href="#confval-mgr-prometheus-rbd_stats_pools" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p>&lt;empty string&gt;</p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mgr-prometheus-rbd_stats_pools_refresh_interval">
<span class="sig-name descname"><span class="pre">rbd_stats_pools_refresh_interval</span></span><a class="headerlink" href="#confval-mgr-prometheus-rbd_stats_pools_refresh_interval" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">300</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mgr-prometheus-standby_behaviour">
<span class="sig-name descname"><span class="pre">standby_behaviour</span></span><a class="headerlink" href="#confval-mgr-prometheus-standby_behaviour" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">default</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mgr-prometheus-standby_error_status_code">
<span class="sig-name descname"><span class="pre">standby_error_status_code</span></span><a class="headerlink" href="#confval-mgr-prometheus-standby_error_status_code" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">500</span></code></p>
</dd>
<dt class="field-odd">allowed range<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">[400,</span> <span class="pre">599]</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mgr-prometheus-exclude_perf_counters">
<span class="sig-name descname"><span class="pre">exclude_perf_counters</span></span><a class="headerlink" href="#confval-mgr-prometheus-exclude_perf_counters" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Gathering perf-counters from a single Prometheus exporter can degrade
ceph-mgr performance, especially in large clusters. Instead, Ceph-
exporter daemons are now used by default for perf-counter gathering.
This should only be disabled when no ceph-exporters are deployed.</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<p>By default the module will accept HTTP requests on port <code class="docutils literal notranslate"><span class="pre">9283</span></code> on all IPv4
and IPv6 addresses on the host.  The port and listen address are both
configurable with <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">config</span> <span class="pre">set</span></code>, with keys
<code class="docutils literal notranslate"><span class="pre">mgr/prometheus/server_addr</span></code> and <code class="docutils literal notranslate"><span class="pre">mgr/prometheus/server_port</span></code>.  This port
is registered with Prometheus’s <a class="reference external" href="https://github.com/prometheus/prometheus/wiki/Default-port-allocations">registry</a>.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr<span class="w"> </span>mgr/prometheus/server_addr<span class="w"> </span><span class="m">0</span>.0.0.</span>
<span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr<span class="w"> </span>mgr/prometheus/server_port<span class="w"> </span><span class="m">9283</span></span>
</pre></div></div><div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The <a class="reference internal" href="#confval-mgr-prometheus-scrape_interval"><code class="xref std std-confval docutils literal notranslate"><span class="pre">mgr/prometheus/scrape_interval</span></code></a> of this module should always be set to match
Prometheus’ scrape interval to work properly and not cause any issues.</p>
</div>
<p>The scrape interval in the module is used for caching purposes
and to determine when a cache is stale.</p>
<p>It is not recommended to use a scrape interval below 10 seconds.  It is
recommended to use 15 seconds as scrape interval, though, in some cases it
might be useful to increase the scrape interval.</p>
<p>To set a different scrape interval in the Prometheus module, set
<code class="docutils literal notranslate"><span class="pre">scrape_interval</span></code> to the desired value:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr<span class="w"> </span>mgr/prometheus/scrape_interval<span class="w"> </span><span class="m">20</span></span>
</pre></div></div><p>On large clusters (&gt;1000 OSDs), the time to fetch the metrics may become
significant.  Without the cache, the Prometheus manager module could, especially
in conjunction with multiple Prometheus instances, overload the manager and lead
to unresponsive or crashing Ceph manager instances.  Hence, the cache is enabled
by default.  This means that there is a possibility that the cache becomes
stale.  The cache is considered stale when the time to fetch the metrics from
Ceph exceeds the configured <a class="reference internal" href="#confval-mgr-prometheus-scrape_interval"><code class="xref std std-confval docutils literal notranslate"><span class="pre">mgr/prometheus/scrape_interval</span></code></a>.</p>
<p>If that is the case, <strong>a warning will be logged</strong> and the module will either</p>
<ul class="simple">
<li><p>respond with a 503 HTTP status code (service unavailable) or,</p></li>
<li><p>it will return the content of the cache, even though it might be stale.</p></li>
</ul>
<p>This behavior can be configured. By default, it will return a 503 HTTP status
code (service unavailable). You can set other options using the <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">config</span>
<span class="pre">set</span></code> commands.</p>
<p>To tell the module to respond with possibly stale data, set it to <code class="docutils literal notranslate"><span class="pre">return</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr<span class="w"> </span>mgr/prometheus/stale_cache_strategy<span class="w"> </span><span class="k">return</span></span>
</pre></div></div><p>To tell the module to respond with “service unavailable”, set it to <code class="docutils literal notranslate"><span class="pre">fail</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr<span class="w"> </span>mgr/prometheus/stale_cache_strategy<span class="w"> </span>fail</span>
</pre></div></div><p>If you are confident that you don’t require the cache, you can disable it:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr<span class="w"> </span>mgr/prometheus/cache<span class="w"> </span><span class="nb">false</span></span>
</pre></div></div><p>If you are using the prometheus module behind some kind of reverse proxy or
loadbalancer, you can simplify discovering the active instance by switching
to <code class="docutils literal notranslate"><span class="pre">error</span></code>-mode:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr<span class="w"> </span>mgr/prometheus/standby_behaviour<span class="w"> </span>error</span>
</pre></div></div><p>If set, the prometheus module will respond with a HTTP error when requesting <code class="docutils literal notranslate"><span class="pre">/</span></code>
from the standby instance. The default error code is 500, but you can configure
the HTTP response code with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr<span class="w"> </span>mgr/prometheus/standby_error_status_code<span class="w"> </span><span class="m">503</span></span>
</pre></div></div><p>Valid error codes are between 400-599.</p>
<p>To switch back to the default behaviour, simply set the config key to <code class="docutils literal notranslate"><span class="pre">default</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr<span class="w"> </span>mgr/prometheus/standby_behaviour<span class="w"> </span>default</span>
</pre></div></div></section>
<section id="ceph">
<span id="prometheus-rbd-io-statistics"></span><h3>Ceph 健康检查<a class="headerlink" href="#ceph" title="Permalink to this heading"></a></h3>
<p>The mgr/prometheus module also tracks and maintains a history of Ceph health checks,
exposing them to the Prometheus server as discrete metrics. This allows Prometheus
alert rules to be configured for specific health check events.</p>
<p>The metrics take the following form;</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># HELP ceph_health_detail healthcheck status by type (0=inactive, 1=active)</span>
<span class="c1"># TYPE ceph_health_detail gauge</span>
<span class="n">ceph_health_detail</span><span class="p">{</span><span class="n">name</span><span class="o">=</span><span class="s2">&quot;OSDMAP_FLAGS&quot;</span><span class="p">,</span><span class="n">severity</span><span class="o">=</span><span class="s2">&quot;HEALTH_WARN&quot;</span><span class="p">}</span> <span class="mf">0.0</span>
<span class="n">ceph_health_detail</span><span class="p">{</span><span class="n">name</span><span class="o">=</span><span class="s2">&quot;OSD_DOWN&quot;</span><span class="p">,</span><span class="n">severity</span><span class="o">=</span><span class="s2">&quot;HEALTH_WARN&quot;</span><span class="p">}</span> <span class="mf">1.0</span>
<span class="n">ceph_health_detail</span><span class="p">{</span><span class="n">name</span><span class="o">=</span><span class="s2">&quot;PG_DEGRADED&quot;</span><span class="p">,</span><span class="n">severity</span><span class="o">=</span><span class="s2">&quot;HEALTH_WARN&quot;</span><span class="p">}</span> <span class="mf">1.0</span>
</pre></div>
</div>
<p>The health check history is made available through the following commands;</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">healthcheck</span> <span class="n">history</span> <span class="n">ls</span> <span class="p">[</span><span class="o">--</span><span class="nb">format</span> <span class="p">{</span><span class="n">plain</span><span class="o">|</span><span class="n">json</span><span class="o">|</span><span class="n">json</span><span class="o">-</span><span class="n">pretty</span><span class="p">}]</span>
<span class="n">healthcheck</span> <span class="n">history</span> <span class="n">clear</span>
</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">ls</span></code> command provides an overview of the health checks that the cluster has
encountered, or since the last <code class="docutils literal notranslate"><span class="pre">clear</span></code> command was issued. The example below;</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">ceph</span><span class="p">:</span> <span class="n">root</span><span class="nd">@c8</span><span class="o">-</span><span class="n">node1</span> <span class="o">/</span><span class="p">]</span><span class="c1"># ceph healthcheck history ls</span>
<span class="n">Healthcheck</span> <span class="n">Name</span>          <span class="n">First</span> <span class="n">Seen</span> <span class="p">(</span><span class="n">UTC</span><span class="p">)</span>      <span class="n">Last</span> <span class="n">seen</span> <span class="p">(</span><span class="n">UTC</span><span class="p">)</span>       <span class="n">Count</span>  <span class="n">Active</span>
<span class="n">OSDMAP_FLAGS</span>              <span class="mi">2021</span><span class="o">/</span><span class="mi">09</span><span class="o">/</span><span class="mi">16</span> <span class="mi">03</span><span class="p">:</span><span class="mi">17</span><span class="p">:</span><span class="mi">47</span>   <span class="mi">2021</span><span class="o">/</span><span class="mi">09</span><span class="o">/</span><span class="mi">16</span> <span class="mi">22</span><span class="p">:</span><span class="mi">07</span><span class="p">:</span><span class="mi">40</span>       <span class="mi">2</span>    <span class="n">No</span>
<span class="n">OSD_DOWN</span>                  <span class="mi">2021</span><span class="o">/</span><span class="mi">09</span><span class="o">/</span><span class="mi">17</span> <span class="mi">00</span><span class="p">:</span><span class="mi">11</span><span class="p">:</span><span class="mi">59</span>   <span class="mi">2021</span><span class="o">/</span><span class="mi">09</span><span class="o">/</span><span class="mi">17</span> <span class="mi">00</span><span class="p">:</span><span class="mi">11</span><span class="p">:</span><span class="mi">59</span>       <span class="mi">1</span>   <span class="n">Yes</span>
<span class="n">PG_DEGRADED</span>               <span class="mi">2021</span><span class="o">/</span><span class="mi">09</span><span class="o">/</span><span class="mi">17</span> <span class="mi">00</span><span class="p">:</span><span class="mi">11</span><span class="p">:</span><span class="mi">59</span>   <span class="mi">2021</span><span class="o">/</span><span class="mi">09</span><span class="o">/</span><span class="mi">17</span> <span class="mi">00</span><span class="p">:</span><span class="mi">11</span><span class="p">:</span><span class="mi">59</span>       <span class="mi">1</span>   <span class="n">Yes</span>
<span class="mi">3</span> <span class="n">health</span> <span class="n">check</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="n">listed</span>
</pre></div>
</div>
</section>
<section id="rbd-io">
<h3>RBD IO 统计<a class="headerlink" href="#rbd-io" title="Permalink to this heading"></a></h3>
<p>The module can optionally collect RBD per-image IO statistics by enabling
dynamic OSD performance counters. The statistics are gathered for all images
in the pools that are specified in the <code class="docutils literal notranslate"><span class="pre">mgr/prometheus/rbd_stats_pools</span></code>
configuration parameter. The parameter is a comma or space separated list
of <code class="docutils literal notranslate"><span class="pre">pool[/namespace]</span></code> entries. If the namespace is not specified the
statistics are collected for all namespaces in the pool.</p>
<p>Example to activate the RBD-enabled pools <code class="docutils literal notranslate"><span class="pre">pool1</span></code>, <code class="docutils literal notranslate"><span class="pre">pool2</span></code> and <code class="docutils literal notranslate"><span class="pre">poolN</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr<span class="w"> </span>mgr/prometheus/rbd_stats_pools<span class="w"> </span><span class="s2">&quot;pool1,pool2,poolN&quot;</span></span>
</pre></div></div><p>The wildcard can be used to indicate all pools or namespaces:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr<span class="w"> </span>mgr/prometheus/rbd_stats_pools<span class="w"> </span><span class="s2">&quot;*&quot;</span></span>
</pre></div></div><p>The module makes the list of all available images scanning the specified
pools and namespaces and refreshes it periodically. The period is
configurable via the <code class="docutils literal notranslate"><span class="pre">mgr/prometheus/rbd_stats_pools_refresh_interval</span></code>
parameter (in sec) and is 300 sec (5 minutes) by default. The module will
force refresh earlier if it detects statistics from a previously unknown
RBD image.</p>
<p>Example to turn up the sync interval to 10 minutes:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr<span class="w"> </span>mgr/prometheus/rbd_stats_pools_refresh_interval<span class="w"> </span><span class="m">600</span></span>
</pre></div></div></section>
<section id="ceph-daemon-performance-counters-metrics">
<h3>Ceph daemon performance counters metrics<a class="headerlink" href="#ceph-daemon-performance-counters-metrics" title="Permalink to this heading"></a></h3>
<p>With the introduction of <code class="docutils literal notranslate"><span class="pre">ceph-exporter</span></code> daemon, the prometheus module will no longer export Ceph daemon
perf counters as prometheus metrics by default. However, one may re-enable exporting these metrics by setting
the module option <code class="docutils literal notranslate"><span class="pre">exclude_perf_counters</span></code> to <code class="docutils literal notranslate"><span class="pre">false</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>mgr<span class="w"> </span>mgr/prometheus/exclude_perf_counters<span class="w"> </span><span class="nb">false</span></span>
</pre></div></div></section>
</section>
<section id="id3">
<h2>统计的名字和标签<a class="headerlink" href="#id3" title="Permalink to this heading"></a></h2>
<p>The names of the stats are exactly as Ceph names them, with
illegal characters <code class="docutils literal notranslate"><span class="pre">.</span></code>, <code class="docutils literal notranslate"><span class="pre">-</span></code> and <code class="docutils literal notranslate"><span class="pre">::</span></code> translated to <code class="docutils literal notranslate"><span class="pre">_</span></code>,
and <code class="docutils literal notranslate"><span class="pre">ceph_</span></code> prefixed to all names.</p>
<p>All <em>daemon</em> statistics have a <code class="docutils literal notranslate"><span class="pre">ceph_daemon</span></code> label such as “osd.123”
that identifies the type and ID of the daemon they come from.  Some
statistics can come from different types of daemon, so when querying
e.g. an OSD’s RocksDB stats, you would probably want to filter
on ceph_daemon starting with “osd” to avoid mixing in the monitor
rocksdb stats.</p>
<p>The <em>cluster</em> statistics (i.e. those global to the Ceph cluster)
have labels appropriate to what they report on.  For example,
metrics relating to pools have a <code class="docutils literal notranslate"><span class="pre">pool_id</span></code> label.</p>
<p>The long running averages that represent the histograms from core Ceph
are represented by a pair of <code class="docutils literal notranslate"><span class="pre">&lt;name&gt;_sum</span></code> and <code class="docutils literal notranslate"><span class="pre">&lt;name&gt;_count</span></code> metrics.
This is similar to how histograms are represented in <a class="reference external" href="https://prometheus.io/docs/concepts/metric_types/#histogram">Prometheus</a>
and they can also be treated <a class="reference external" href="https://prometheus.io/docs/practices/histograms/">similarly</a>.</p>
<section id="osd">
<h3>存储池和 OSD 元数据系列<a class="headerlink" href="#osd" title="Permalink to this heading"></a></h3>
<p>Special series are output to enable displaying and querying on
certain metadata fields.</p>
<p>Pools have a <code class="docutils literal notranslate"><span class="pre">ceph_pool_metadata</span></code> field like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph_pool_metadata</span><span class="p">{</span><span class="n">pool_id</span><span class="o">=</span><span class="s2">&quot;2&quot;</span><span class="p">,</span><span class="n">name</span><span class="o">=</span><span class="s2">&quot;cephfs_metadata_a&quot;</span><span class="p">}</span> <span class="mf">1.0</span>
</pre></div>
</div>
<p>OSDs have a <code class="docutils literal notranslate"><span class="pre">ceph_osd_metadata</span></code> field like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph_osd_metadata</span><span class="p">{</span><span class="n">cluster_addr</span><span class="o">=</span><span class="s2">&quot;172.21.9.34:6802/19096&quot;</span><span class="p">,</span><span class="n">device_class</span><span class="o">=</span><span class="s2">&quot;ssd&quot;</span><span class="p">,</span><span class="n">ceph_daemon</span><span class="o">=</span><span class="s2">&quot;osd.0&quot;</span><span class="p">,</span><span class="n">public_addr</span><span class="o">=</span><span class="s2">&quot;172.21.9.34:6801/19096&quot;</span><span class="p">,</span><span class="n">weight</span><span class="o">=</span><span class="s2">&quot;1.0&quot;</span><span class="p">}</span> <span class="mf">1.0</span>
</pre></div>
</div>
</section>
<section id="node-exporter">
<h3>关联驱动器统计信息与 node_exporter<a class="headerlink" href="#node-exporter" title="Permalink to this heading"></a></h3>
<p>The prometheus output from Ceph is designed to be used in conjunction
with the generic host monitoring from the Prometheus node_exporter.</p>
<p>To enable correlation of Ceph OSD statistics with node_exporter’s
drive statistics, special series are output like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph_disk_occupation</span><span class="p">{</span><span class="n">ceph_daemon</span><span class="o">=</span><span class="s2">&quot;osd.0&quot;</span><span class="p">,</span><span class="n">device</span><span class="o">=</span><span class="s2">&quot;sdd&quot;</span><span class="p">,</span> <span class="n">exported_instance</span><span class="o">=</span><span class="s2">&quot;myhost&quot;</span><span class="p">}</span>
</pre></div>
</div>
<p>To use this to get disk statistics by OSD ID, use either the <code class="docutils literal notranslate"><span class="pre">and</span></code> operator or
the <code class="docutils literal notranslate"><span class="pre">*</span></code> operator in your prometheus query. All metadata metrics (like ``
ceph_disk_occupation`` have the value 1 so they act neutral with <code class="docutils literal notranslate"><span class="pre">*</span></code>. Using <code class="docutils literal notranslate"><span class="pre">*</span></code>
allows to use <code class="docutils literal notranslate"><span class="pre">group_left</span></code> and <code class="docutils literal notranslate"><span class="pre">group_right</span></code> grouping modifiers, so that
the resulting metric has additional labels from one side of the query.</p>
<p>See the
<a class="reference external" href="https://prometheus.io/docs/prometheus/latest/querying/basics">prometheus documentation</a> for more information about constructing queries.</p>
<p>The goal is to run a query like</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rate</span><span class="p">(</span><span class="n">node_disk_written_bytes_total</span><span class="p">[</span><span class="mi">30</span><span class="n">s</span><span class="p">])</span> <span class="ow">and</span>
<span class="n">on</span> <span class="p">(</span><span class="n">device</span><span class="p">,</span><span class="n">instance</span><span class="p">)</span> <span class="n">ceph_disk_occupation_human</span><span class="p">{</span><span class="n">ceph_daemon</span><span class="o">=</span><span class="s2">&quot;osd.0&quot;</span><span class="p">}</span>
</pre></div>
</div>
<p>Out of the box the above query will not return any metrics since the <code class="docutils literal notranslate"><span class="pre">instance</span></code> labels of
both metrics don’t match. The <code class="docutils literal notranslate"><span class="pre">instance</span></code> label of <code class="docutils literal notranslate"><span class="pre">ceph_disk_occupation</span></code>
will be the currently active MGR node.</p>
<p>The following two section outline two approaches to remedy this.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>If you need to group on the <cite>ceph_daemon</cite> label instead of <cite>device</cite> and
<cite>instance</cite> labels, using <cite>ceph_disk_occupation_human</cite> may not work reliably.
It is advised that you use <cite>ceph_disk_occupation</cite> instead.</p>
<p>The difference is that <cite>ceph_disk_occupation_human</cite> may group several OSDs
into the value of a single <cite>ceph_daemon</cite> label in cases where multiple OSDs
share a disk.</p>
</div>
</section>
</section>
<section id="label-replace">
<h2>使用 label_replace<a class="headerlink" href="#label-replace" title="Permalink to this heading"></a></h2>
<p>The <code class="docutils literal notranslate"><span class="pre">label_replace</span></code> function (cp.
<a class="reference external" href="https://prometheus.io/docs/prometheus/latest/querying/functions/#label_replace">label_replace documentation</a>)
can add a label to, or alter a label of, a metric within a query.</p>
<p>To correlate an OSD and its disks write rate, the following query can be used:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">label_replace</span><span class="p">(</span>
    <span class="n">rate</span><span class="p">(</span><span class="n">node_disk_written_bytes_total</span><span class="p">[</span><span class="mi">30</span><span class="n">s</span><span class="p">]),</span>
    <span class="s2">&quot;exported_instance&quot;</span><span class="p">,</span>
    <span class="s2">&quot;$1&quot;</span><span class="p">,</span>
    <span class="s2">&quot;instance&quot;</span><span class="p">,</span>
    <span class="s2">&quot;(.*):.*&quot;</span>
<span class="p">)</span> <span class="ow">and</span> <span class="n">on</span> <span class="p">(</span><span class="n">device</span><span class="p">,</span> <span class="n">exported_instance</span><span class="p">)</span> <span class="n">ceph_disk_occupation_human</span><span class="p">{</span><span class="n">ceph_daemon</span><span class="o">=</span><span class="s2">&quot;osd.0&quot;</span><span class="p">}</span>
</pre></div>
</div>
</section>
<section id="id6">
<h2>Prometheus 服务器的配置<a class="headerlink" href="#id6" title="Permalink to this heading"></a></h2>
<section id="honor-labels">
<h3>honor_labels<a class="headerlink" href="#honor-labels" title="Permalink to this heading"></a></h3>
<p>To enable Ceph to output properly-labeled data relating to any host,
use the <code class="docutils literal notranslate"><span class="pre">honor_labels</span></code> setting when adding the ceph-mgr endpoints
to your prometheus configuration.</p>
<p>This allows Ceph to export the proper <code class="docutils literal notranslate"><span class="pre">instance</span></code> label without prometheus
overwriting it. Without this setting, Prometheus applies an <code class="docutils literal notranslate"><span class="pre">instance</span></code> label
that includes the hostname and port of the endpoint that the series came from.
Because Ceph clusters have multiple manager daemons, this results in an
<code class="docutils literal notranslate"><span class="pre">instance</span></code> label that changes spuriously when the active manager daemon
changes.</p>
<p>If this is undesirable a custom <code class="docutils literal notranslate"><span class="pre">instance</span></code> label can be set in the
Prometheus target configuration: you might wish to set it to the hostname
of your first mgr daemon, or something completely arbitrary like “ceph_cluster”.</p>
</section>
<section id="id7">
<h3>node_exporter 主机名标签<a class="headerlink" href="#id7" title="Permalink to this heading"></a></h3>
<p>Set your <code class="docutils literal notranslate"><span class="pre">instance</span></code> labels to match what appears in Ceph’s OSD metadata
in the <code class="docutils literal notranslate"><span class="pre">instance</span></code> field.  This is generally the short hostname of the node.</p>
<p>This is only necessary if you want to correlate Ceph stats with host stats,
but you may find it useful to do it in all cases in case you want to do
the correlation in the future.</p>
</section>
<section id="id8">
<h3>配置实例<a class="headerlink" href="#id8" title="Permalink to this heading"></a></h3>
<p>This example shows a single node configuration running ceph-mgr and
node_exporter on a server called <code class="docutils literal notranslate"><span class="pre">senta04</span></code>. Note that this requires one
to add an appropriate and unique <code class="docutils literal notranslate"><span class="pre">instance</span></code> label to each <code class="docutils literal notranslate"><span class="pre">node_exporter</span></code> target.</p>
<p>This is just an example: there are other ways to configure prometheus
scrape targets and label rewrite rules.</p>
<section id="prometheus-yml">
<h4>prometheus.yml<a class="headerlink" href="#prometheus-yml" title="Permalink to this heading"></a></h4>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">global</span><span class="p">:</span>
  <span class="n">scrape_interval</span><span class="p">:</span>     <span class="mi">15</span><span class="n">s</span>
  <span class="n">evaluation_interval</span><span class="p">:</span> <span class="mi">15</span><span class="n">s</span>

<span class="n">scrape_configs</span><span class="p">:</span>
  <span class="o">-</span> <span class="n">job_name</span><span class="p">:</span> <span class="s1">&#39;node&#39;</span>
    <span class="n">file_sd_configs</span><span class="p">:</span>
      <span class="o">-</span> <span class="n">files</span><span class="p">:</span>
        <span class="o">-</span> <span class="n">node_targets</span><span class="o">.</span><span class="n">yml</span>
  <span class="o">-</span> <span class="n">job_name</span><span class="p">:</span> <span class="s1">&#39;ceph&#39;</span>
    <span class="n">honor_labels</span><span class="p">:</span> <span class="n">true</span>
    <span class="n">file_sd_configs</span><span class="p">:</span>
      <span class="o">-</span> <span class="n">files</span><span class="p">:</span>
        <span class="o">-</span> <span class="n">ceph_targets</span><span class="o">.</span><span class="n">yml</span>
</pre></div>
</div>
</section>
<section id="ceph-targets-yml">
<h4>ceph_targets.yml<a class="headerlink" href="#ceph-targets-yml" title="Permalink to this heading"></a></h4>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">&quot;targets&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="s2">&quot;senta04.mydomain.com:9283&quot;</span> <span class="p">],</span>
        <span class="s2">&quot;labels&quot;</span><span class="p">:</span> <span class="p">{}</span>
    <span class="p">}</span>
<span class="p">]</span>
</pre></div>
</div>
</section>
<section id="node-targets-yml">
<h4>node_targets.yml<a class="headerlink" href="#node-targets-yml" title="Permalink to this heading"></a></h4>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">&quot;targets&quot;</span><span class="p">:</span> <span class="p">[</span> <span class="s2">&quot;senta04.mydomain.com:9100&quot;</span> <span class="p">],</span>
        <span class="s2">&quot;labels&quot;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s2">&quot;instance&quot;</span><span class="p">:</span> <span class="s2">&quot;senta04&quot;</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">]</span>
</pre></div>
</div>
</section>
</section>
</section>
<section id="id9">
<h2>注意事项<a class="headerlink" href="#id9" title="Permalink to this heading"></a></h2>
<p>Counters and gauges are exported; currently histograms and long-running
averages are not.  It’s possible that Ceph’s 2-D histograms could be
reduced to two separate 1-D histograms, and that long-running averages
could be exported as Prometheus’ Summary type.</p>
<p>Timestamps, as with many Prometheus exporters, are established by
the server’s scrape time (Prometheus expects that it is polling the
actual counter process synchronously).  It is possible to supply a
timestamp along with the stat report, but the Prometheus team strongly
advises against this.  This means that timestamps will be delayed by
an unpredictable amount; it’s not clear if this will be problematic,
but it’s worth knowing about.</p>
</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../localpool/" class="btn btn-neutral float-left" title="本地存储池模块" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../influx/" class="btn btn-neutral float-right" title="Influx 模块" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>